home *** CD-ROM | disk | FTP | other *** search
- /*
- ** CTCPSessionDoc.h
- **
- ** TurboTCP support library
- ** TCP session document
- **
- ** Copyright © 1993-94, FrostByte Design / Eric Scouten
- **
- */
-
-
- #pragma once
-
- #include "CDocument.h"
- #include "CFile.h"
- #include "CWindow.h"
-
- #include "CTCPEndpoint.h"
-
-
- /*______________________________________________________________________
- **
- ** CTCPSessionDoc
- **
- ** This abstract class is provided to link the TCL CDocument class with the TurboTCP
- ** CTCPStream class. View this as a “connection session” document; this is the point at
- ** which the user interaction with the TCP session is handled.
- **
- ** This class provides all of the necessary behaviors for opening and closing a session.
- ** It provides abstract methods for receiving data and handling various TCP notifications.
- ** By default, it sets the window title to the name of the remote host. You may also
- ** configure it to show the document’s filename, both hostname & filename, or neither.
- ** (See the fields showFileName and showHostName and the method AutoTitle.
- **
- ** This class does not implement any specific TCP protocol. You will need to subclass it
- ** to provide the behaviors specific to the protocol you are implementing. You may want
- ** to examine and use the CTelnetTerminal class in MiniTelnet to see how this may be done.
- **
- ** NOTE: This class is provided only as a convenience. You need not include it in your project.
- ** It is retained primarily for compatibility with TurboTCP 1.0.
- **
- */
-
-
- class CTCPSessionDoc : public CDocument, public CTCPEndpoint {
-
- TCL_DECLARE_CLASS;
-
-
- // constructors
-
- public:
- // note new parameter sequence
- CTCPSessionDoc(unsigned short theDefaultPort,
- unsigned long recBufferSize = recReceiveSize,
- unsigned short autoReceiveSize = recAutoRecSize,
- unsigned short autoReceiveNum = recAutoRecNum,
- Boolean doUseCName = TRUE,
- Boolean printable = TRUE)
- : CDocument(printable),
- CTCPEndpoint(theDefaultPort, recBufferSize, autoReceiveSize,
- autoReceiveNum, doUseCName)
- {}
-
- void ITCPSessionDoc(CApplication* aSupervisor, Boolean printable)
- { IDocument(aSupervisor, printable); } // for compatibility only
-
-
- //
- // TurboTCP 1.0 NOTE: All of the methods which were in CTCPSessionDoc (OpenUserHost,
- // Close, etc.) are now inherited from CTCPEndpoint instead.
- //
-
-
- // closing windows & sessions
-
- virtual Boolean Close(Boolean quitting);
- virtual void RemoteClose();
-
-
- // window titling
-
- virtual void SetWindowTitle(Str255 newTitle)
- { if (itsWindow) itsWindow->SetTitle(newTitle); }
- virtual void GetFileName(Str255 theName)
- { if (itsFile) itsFile->GetName(theName); else theName[0] = '\0'; }
-
-
- // CDocument methods which are not implemented here
-
- virtual void NewFile() {};
- virtual void OpenFile(SFReply* macSFReply) {};
-
- };